package org.vgou.service;

import java.util.List;

import org.vgou.model.Business;

/**
 * 
 * Copyright (c) 2011, vgou<br>
 * All rights reserved.<br>
 * 
 * @since 2011-11-27
 * @author <a href="mailto:jason.hxx@gmail.com">jason</a>
 * @version Id: IBusinessService.java
 * @comment 商家服务接口类
 * 
 */
public interface IBusinessService {

	/**
	 * 创建商家记录
	 * 
	 * @param user
	 * @return
	 * @throws Exception
	 */
	long create(Business business) throws Exception;

	/**
	 * 修改商家记录
	 * 
	 * @param business
	 * @return
	 * @throws Exception
	 */
	int update(Business business) throws Exception;

	/**
	 * 删除商家记录
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	int del(long id) throws Exception;

	/**
	 * 修改商家状态
	 * 
	 * @param id
	 * @param status
	 *            修改后的状态
	 * @return
	 * @throws Exception
	 */
	int updateStatus(long id, int status) throws Exception;

	/**
	 * 根据商家ID取得商家记录
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	Business getById(long id) throws Exception;

	/**
	 * 取得指定条件下的商家数目
	 * 
	 * @param businessName
	 *            商家名称
	 * @param status
	 *            状态
	 * @return
	 * @throws Exception
	 */
	int getAllCount(String businessName, int status) throws Exception;

	/**
	 * 取得指定条件下的商家集合
	 * 
	 * @param businessName
	 *            商家名称
	 * @param status
	 *            状态
	 * @param orderBy
	 *            排序属性
	 * @param isAsc
	 *            是否升序
	 * @param startPage
	 *            分页开始索引
	 * @param pageSize
	 *            每页显示数目
	 * @return
	 * @throws Exception
	 */
	List<Business> getAll(String businessName, int status, String orderBy,
			boolean isAsc, int startPage, int pageSize) throws Exception;
}
